﻿@model ArivisTests.Models.TestScenario
@using ArivisTests.Views;

@{
    ViewBag.Title = "Delete";
    bool inUse = Model.Plans.Any() || Model.Cases.Any();
}

@section Navigation{
    @Html.ActionLink("Test Scenarios", "Index") &rsaquo; Delete
}

@if (inUse)
{
    <h3>This scenario is currently in use and can not be deleted.</h3>
} else {
    <h3>Are you sure you want to delete this?</h3>
}
<fieldset>
    <legend>TestScenario</legend>

    <table class="display-table">
        <tr>
            <td class="display-label">
                @Html.DisplayNameFor(model => model.Name)
            </td>
            <td class="display-field">
                @Html.DisplayFor(model => model.Name)
            </td>
        </tr>
        <tr>
            <td class="display-label">
                @Html.DisplayNameFor(model => model.Duration)
            </td>
            <td class="display-field">
                @Html.DisplayFor(model => model.Duration)
            </td>
        </tr>
        <tr>
            <td class="display-label">
                @Html.DisplayNameFor(model => model.Owner)
            </td>
            <td class="display-field">
                @Html.DisplayFor(model => model.Owner.UserName)
            </td>
        </tr>
        <tr>
            <td class="display-label">
                @Html.DisplayNameFor(model => model.Url)
            </td>
            <td class="display-field">
                @Html.DisplayFor(model => model.Url)
            </td>
        </tr>
    </table>
</fieldset>
@if (!inUse)
{
    using (Html.BeginForm()) {
    <p>
        <input type="submit" value="Delete" />
    </p>
    }
}
